#ifndef _LFS_H_
#define _LFS_H_

#include "los_compiler.h"
#include "los_fs.h"
#ifdef __cplusplus
extern "C" {
#endif

typedef enum {
    FLASH_PARTITION_DATA0 = 0,
    FLASH_PARTITION_DATA1 = 1,
    FLASH_PARTITION_MAX,
} HalPartition;

typedef struct {
    const CHAR *partitionDescription; // 分区名字
    UINT32 partitionStartAddr;  // 分区起始地址
    UINT32 partitionLength;     // 分区长度
    UINT32 partitionOptions;    // 其他参数
} HalLogicPartition;

typedef struct {
    CHAR *mount_point;  // 分区挂载点
    struct PartitionCfg partCfg;    // 分区配置
}fs_cfg;

HalLogicPartition *getPartitionInfo(VOID);
INT32 fs_init();
INT32 lfs_erase(HalPartition in_partition, UINT32 off_set, UINT32 size);
INT32 lfs_write(HalPartition in_partition, UINT32 *off_set, const VOID *in_buf, UINT32 in_buf_len);
INT32 lfs_erase_write(HalPartition in_partition, UINT32 *off_set, const VOID *in_buf, UINT32 in_buf_len);
INT32 lfs_read(HalPartition in_partition, UINT32 *off_set, VOID *out_buf, UINT32 in_buf_len);

#ifdef __cplusplus
}
#endif

#endif /* _RAM_VIRT_FLASH_H_ */